package com.tree.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tree.backend.entity.pojo.PartyMember;
import com.tree.backend.entity.vo.MemberComposition;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 党员基本信息表，记录党员的个人信息和工作情况 Mapper 接口
 * </p>
 *
 * @author tree
 * @since 2025-10-15
 */
public interface PartyMemberMapper extends BaseMapper<PartyMember> {

    @Select("select education as \"educationTypes\",\n" +
            "       count(gender=1) as \"maleData\",\n" +
            "       count(gender=2) as \"femaleData\"\n" +
            "       from party_member\n" +
            "group by education;")
    List<MemberComposition> getComposition();
}
